package com.morven.workpiece.craft.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.morven.workpiece.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 工序类别对象 craft_proce_category_type
 *
 * @author Morven
 * @date 2021-12-20
 */
public class CraftProceCategoryType extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增长
     */
    private Long id;

    /**
     * 工序类别
     */
    private String proceCategoryType;

    /**
     * 工序父类ID
     */
    private Long parentId;

    /**
     * 创建用户ID
     */
    private Long createUserId;

    /**
     * 操作用户ID
     */
    private Long opUserId;

    /**
     * 操作时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date opTime;

    private List<CraftProceCategoryType> children = new ArrayList<>();

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setProceCategoryType(String proceCategoryType) {
        this.proceCategoryType = proceCategoryType;
    }

    public String getProceCategoryType() {
        return proceCategoryType;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setOpUserId(Long opUserId) {
        this.opUserId = opUserId;
    }

    public Long getOpUserId() {
        return opUserId;
    }

    public void setOpTime(Date opTime) {
        this.opTime = opTime;
    }

    public Date getOpTime() {
        return opTime;
    }

    public List<CraftProceCategoryType> getChildren() {
        return children;
    }

    public void setChildren(List<CraftProceCategoryType> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("proceCategoryType", getProceCategoryType())
                .append("parentId", getParentId())
                .append("createUserId", getCreateUserId())
                .append("createTime", getCreateTime())
                .append("opUserId", getOpUserId())
                .append("opTime", getOpTime())
                .toString();
    }
}
